package BookTest;

import java.util.Scanner;

public class I12Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入密码：");
        String password = sc.next();
        if(password.length() < 8 || password.length() > 20) {
            System.out.println("输入密码错误");
        }else{
            String str = "^(?![A-Za-z]+$)(?![A-Z0-9]+$)(?![a-z0-9]+$)[A-Za-z0-9]{8,20}$";
            System.out.println(str.matches(password));
            if(str.matches(password)){
                System.out.println("此密码符合要求");
            }
            else{
                System.out.println("请按要求重新设置密码");
            }
        }
    }
}
